package com.zhengbing.tj.design.decorator;

/**
 * 装饰器模式-耗时统计装饰器
 *
 * @author zhengbing
 * @date 2025-07-21
 */
public class TimeDecorator extends Decorator {
    public TimeDecorator(Component component) {
        super(component);
    }

    @Override
    public void operation() {
        long start = System.currentTimeMillis();
        super.operation();
        long end = System.currentTimeMillis();
        System.out.println("[耗时] 操作耗时: " + (end - start) + " ms");
    }
} 